package com.hex.liyue.lookingdatemodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.commonmodule.utils.L;
import com.hex.liyue.lookingdatemodule.bean.AppointmentDetailsResultBean;

/**
 * Created by WJ on 2016/6/18.
 */
public class InSomeDetailsPresenter {
    private IInSomeDetailsView iInSomeDetailsView;

    public InSomeDetailsPresenter(IInSomeDetailsView iInSomeDetailsView) {
        this.iInSomeDetailsView = iInSomeDetailsView;
    }

    public void requestDetails(String id) {
        iInSomeDetailsView.showLod("加载中...");
        HttpManager.getInstance().findAppointmentDetails(UserManager.getUserId(), id, new ResponseListener<AppointmentDetailsResultBean>() {
            @Override
            public void onSuccess(AppointmentDetailsResultBean appointmentDetailsResultBean) {
                L.e("appointmentDetailsResultBean",appointmentDetailsResultBean.toString());
                iInSomeDetailsView.closeLod();
                iInSomeDetailsView.setAdapter(appointmentDetailsResultBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iInSomeDetailsView.closeLod();
                iInSomeDetailsView.showT(responseresult);
            }
        });
    }

}
